package br.ufms.odontologico.util;

public class JpaUtils {
	
	
	public static String likeAny(String literal){
		int x;
		StringBuilder result = new StringBuilder(literal.trim());
		while((x = result.indexOf("  "))>=0){
			result = result.delete(x, 1);
		}
		while((x = result.indexOf(" "))>=0){
			result.replace(x, 1, "%");
		}
		result.append("%");
		result.insert(0, "%");
		return result.toString();
	}
}
